package modellayer;
/**
 * A class signfying how many of a particular Vare are in a Salg.  
 * 
 * @author (Jonas, Dani og Peter) 
 * @version (09-12-2014)
 */
public class DelSalg
{
    private Vare vare;
    private int antal;
    private double deltotal;

    /**
     * Constructor for objects of class Delsalg.
     */
    public DelSalg(Vare vare, int antal)
    {
        this.vare = vare;
        this.antal = antal;
        this.deltotal = udregnDeltotal();
    }
    
    /**
     * Acessor method for attriute vare.
     */
    public Vare getVare()
    {
        return this.vare;
    }
    
    /**
     * Mutator method for attriute vare.
     */
    public void setVare(Vare vare)
    {
        this.vare = vare;
    }
    
    /**
     * Acessor method for attriute antal.
     */
    public int getAntal()
    {
        return this.antal;
    }
    
    /**
     * Mutator method for attriute antal.
     */
    public void setAntal(int antal)
    {
        this.antal = antal;
    }
    
    /**
     * Acessor method for attriute deltotal.
     */
    public double getDelTotal()
    {
        return this.deltotal;
    }
    
    /**
     * Mutator method for attriute deltotal.
     */
    private double udregnDeltotal()
    {
        double amount = vare.getVejledendeudsalgspris() * antal;
        return amount;
    }
}
